package com.bawei.base.user.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.bawei.base.user.mapper.UserMapper;
import com.bawei.base.user.model.User;
import com.bawei.base.user.model.UserExample;
import com.bawei.base.user.service.UserService;

@Service
public class UserServiceImpl implements UserService {

	@Resource
	private UserMapper userMapper;

	public void addUser(User user) {
		userMapper.insert(user);
	}

	public void updateUser(User user) {
		userMapper.updateByPrimaryKey(user);
	}

	public void deleteUser(Long id) {
		userMapper.deleteByPrimaryKey(id);
	}

	public List<User> getUser() {
		return userMapper.selectByExample(new UserExample());
	}

	public User getUserById(Long id) {
		return userMapper.selectByPrimaryKey(id);
	}





}
